<!--_meta 作为公共模版分离出去-->
<#include "include/_meta.html">
<!--/meta 作为公共模版分离出去-->

<title>添加保险记录- 车辆管理</title>
<meta name="keywords" content="汽车租赁">
<meta name="description" content="H-ui.admin v2.3，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
</head>
<body>
<article class="page-container">
    <form class="form form-horizontal" id="form-car-edit" >
    
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车牌号：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.carcode)!''}" placeholder="车牌号" id="carcode" name="carcode">
        </div>
    </div>
        
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车牌颜色：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.carcolor)!''}"  placeholder="车牌颜色" id="carcolor" name="carcolor">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>购买日期：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})" autocomplete="off" value="${(car.buydate)!''}" placeholder="还车时间" id="buydate" name="buydate">
        </div>
    </div>
            

            <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>发动机型号：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text"  value="${(car.enginenum)!''}" placeholder="发动机型号" id="enginenum" name="enginenum">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车架号：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text"  value="${(car.framenum)!''}" placeholder="车架号" id="framenum" name="framenum">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车辆类型：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.cartype)!''}" placeholder="车辆类型" id="cartype" name="cartype">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车辆品牌：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.carbrand)!''}" placeholder="车辆品牌" id="carbrand" name="carbrand">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>品牌型号：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.carbrandtype)!''}" placeholder="品牌型号" id="carbrandtype" name="carbrandtype">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>车辆图片：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.picid)!''}" placeholder="车辆图片" id="picid" name="picid">
        </div>
    </div>
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>自动手动：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.isauto)!''}" placeholder="自动手动" id="isauto" name="isauto">
        </div>
    </div> 
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>排量大小：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.enginesize)!''}" placeholder="排量大小" id="enginesize" name="enginesize">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>座位数量：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.seatnum?c)!''}" placeholder="座位数量" id="seatnum" name="seatnum">
        </div>
    </div>
            
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>外观类型：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.facetype)!''}" placeholder="外观类型" id="facetype" name="facetype">
        </div>
    </div>
        
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>当前里程数字：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.totalmile?c)!''}" placeholder="当前里程数字" id="totalmile" name="totalmile">
        </div>
    </div>

    
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>下次保养时间：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${(car.maintaintime)!''}" autocomplete="off"  placeholder="下次保养时间" id="maintaintime" name="maintaintime">
        </div>
    </div>
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>下次保养里程：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" autocomplete="off" value="${(car.maintainmile?c)!''}" placeholder="下次保养里程" id="maintainmile" name="maintainmile">
        </div>
    </div>
        


    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>年检到期：</label>
        <div class="formControls col-xs-8 col-sm-9">
        <input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})" value="${(car.yearcheck)!''}"  autocomplete="off" placeholder="还车时间" id="yearcheck" name="yearcheck">
        </div>
    </div>          
    
    
    
    <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>保险到期：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text"  class="input-text Wdate" onfocus="WdatePicker({skin:'whyGreen',startDate:'%y-%M-%d %H:00:00',dateFmt:'yyyy-MM-dd HH:mm:ss'})" autocomplete="off" value="${(car.insurancetime)!''}" placeholder="还车时间" id="insurancetime" name="insurancetime">
        </div>
        
    </div>
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>提醒手机号：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text"  value="${(car.phone)!''}" placeholder="提醒手机号" id="phone" name="phone">
        </div>
        
    </div>
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>每日租金：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text"  value="${(car.dayprice?c)!''}" placeholder="每日租金" id="dayprice" name="dayprice">
        </div>
        
    </div>
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>所在区域城市：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text"  value="${(car.carcity)!''}" placeholder="所在区域城市" id="carcity" name="carcity">
        </div>
    </div>
        
                <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>所属租赁门店：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <input type="text" class="input-text" value="${(car.carcity)!''}" placeholder="所属租赁门店" id="deptname" name="deptname">
        </div>
    </div>
        <div class="row cl">
        <label class="form-label col-xs-4 col-sm-3">车辆信息介绍：</label>
        <div class="formControls col-xs-8 col-sm-9">
            <textarea id="carremark" name="carremark" cols="" rows="" class="textarea"  placeholder="说点什么...100个字符以内" value="${(car.carremark)!''}" dragonfly="true" onKeyUp="textarealength(this,100)"></textarea>
            <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
        </div>
    </div>

    <div class="row cl">
        <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
            <input class="btn btn-primary radius" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;" onclick="$('#form-car-edit').submit()"/>
        </div>
    </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去--> 
<#include "include/_footer.html">
<!--/_footer /作为公共模版分离出去--> 

<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
$(function(){     
    $('.skin-minimal input').iCheck({
     checkboxClass: 'icheckbox-blue',
     radioClass: 'iradio-blue',
     increaseArea: '20%'
  });
    $("#form-car-edit").validate({

      onkeyup:false,
      focusCleanup:true,
      success:"valid",
      submitHandler:function(form){

          $.ajax({
               type: 'put', 
               contentType:"application/json", 
               url:'/editCar/${car.carid}',
               data:   JSON.stringify({
                      'carcode'     :$('#carcode').val(),
                      'carcolor'    :$('#carcolor').val(),
                      'buydate'     :$('#buydate').val(),
                      'enginenum'   :$('#enginenum').val(),
                      'framenum'    :$('#framenum').val(),
                      'cartype'     :$('#cartype').val(),
                      'carbrand'    :$('#carbrand').val(),
                      'carbrandtype':$('#carbrandtype').val(),
                      'picid'       :$('#picid').val(),
                      'isauto'      :$('#isauto').val(), 
                      'enginesize'  :$('#enginesize').val(), 
                      'seatnum'     :$('#seatnum').val(),
                      'facetype'    :$('#facetype').val(),
                      'totalmile'   :$('#totalmile').val(),  
                      'insurancetime':$('#insurancetime').val() ,
                      'yearcheck'   :$('#yearcheck').val(),
                      'maintaintime':$('#maintaintime').val(),   
                      'maintainmile':$('#maintainmile').val(),   
                      'phone'       :$('#phone').val(),
                      'carcity'     :$('#carcity').val(),
                      'dayprice'    :$('#dayprice').val(),   
                      'deptname'    :$('#deptname').val() ,                      
                      'carremark'   :$('#carremark').val()
                        }),
                success:function(data){ 
                    console.log('提交成功！');
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.$("#searchCar").click();
                    parent.layer.close(index);
                }
            })
        }
    });
});
</script> 
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>